package stock.testSB;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.json.JSONArray;

public class Testa {

	public static List<Stock1> listall = new ArrayList<Stock1>();

	public Testa() {
		// 初始化30只股票数据，这里简化为随机生成部分数据

	}

	public static void main(String[] args) {

		SimpleDateFormat sdf = new SimpleDateFormat("MMddHHmmss");
		Date now = new Date();
		String formattedDate = sdf.format(now);
		List<TimeZDF> zdfList1 = new ArrayList<TimeZDF>();
		List<TimeZDF> zdfList2 = new ArrayList<TimeZDF>();
		TimeZDF tz = new TimeZDF();
		tz.setTime(0L);
		tz.setZhangdiefu("0");

		Stock1 Stock1 = new Stock1();

		Stock1.setName("sz002181");
		Stock1.setZdfList(zdfList1);

		Stock1 Stock2 = new Stock1();

		Stock2.setName("sh603270");
		Stock2.setZdfList(zdfList2);
		listall.add(Stock1);
		listall.add(Stock2);

		StockDataUpdater updater = new StockDataUpdater();
		Thread updateThread = new Thread(updater);
		updateThread.start();
		while (true) {
			try {
				Thread.sleep(1000);
				for (int i = 0; i < listall.size(); i++) {
					
					//System.out.println(listall.get(i).getName());
					// System.out.println(JSONArray.fromObject(listall.get(i).getZdfList()).toString());
					
					
					
				}

			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}

	}
}
